<?php
declare (strict_types = 1);
namespace app\admin\model\data;

/**
 * 主订单统计
 */
class SplitCourse extends DataModel
{
    /**
     * 表名
     * @var string
     */
    protected $name = 'user_split_course';

    /**
     * 平台分成
     * Author: 亓官雨树 <lucky.max@foxmail.com>
     * Date: 22/02/16
     *
     * @static
     * @param array $timespan
     * @return float
     */
    public static function getIncomeByTimespan(array $timespan)
    {
        return SplitCourse::whereBetween('create_time', $timespan)->sum('platform_sum');
    }

}
